﻿using System;
using System.Collections.Generic;
using System.Text;
using JsonSharp;
using JsonSharp.Collections;
using JsonSharp.Values;
using Barbar.MapReport.Common.Drawing;

namespace Barbar.MapReport.HtmlRender.Json {
  internal class GeoColorRegionFactory : GeoRegionFactory {
    private ColoredRegionList m_Region;

    public GeoColorRegionFactory(ColoredRegionList geoRegion)
      : base(geoRegion) {
      m_Region = geoRegion;
    }

    public override JsonValue ToJsonObject() {
      JsonObjects result = (JsonObjects)base.ToJsonObject();
      result.Add(new JsonStringValue("FillColor"), new JsonColorValue(m_Region.FillColor.Color));
      result.Add(new JsonStringValue("StrokeColor"), new JsonColorValue(m_Region.StrokeColor.Color));
      return result;
    }
  }
}
